package sing.myapp.ui.calc

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.alibaba.fastjson.JSONObject
import sing.core.base.BaseViewModel
import sing.core.callback.Callback
import sing.core.ext.request


class CalcViewModel(application: Application) : BaseViewModel(application) {

    var pos = MutableLiveData(0)
    var chooseYear = MutableLiveData(20)

    var applyMoney = MutableLiveData("0")
    var repaymentMonth = MutableLiveData("0")
    var firstMonth = MutableLiveData("0") // 首月还款 等额本金
    var decrement = MutableLiveData("0") // 每月递减
    var everyMonth = MutableLiveData("0") // 每月还款 等额本息
    var totalMoney1 = MutableLiveData("0") // 等额本金还款总额
    var totalMoney2 = MutableLiveData("0") // 等额本息还款总额
    var interest1 = MutableLiveData("0") // 等额本金总利息
    var interest2 = MutableLiveData("0") // 等额本息总利息

    fun reSet(){
        applyMoney.value = "0"
        repaymentMonth.value = "0"
        firstMonth.value = "0"
        decrement.value = "0"
        everyMonth.value = "0"
        totalMoney1.value = "0"
        totalMoney2.value = "0"
        interest1.value = "0"
        interest2.value = "0"
    }

    fun setPos(pos:Int){
        this.pos.value = pos
    }


}